import wx

class DragFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None)
        self.tree = wx.TreeCtrl(self, wx.ID_ANY)
        root = self.tree.AddRoot("root item")
        self.tree.AppendItem(root, "child 1")
        self.tree.Bind(wx.EVT_TREE_BEGIN_DRAG, self.__onBeginDrag)        
    def __onBeginDrag(self, event):
        tdo = wx.PyTextDataObject(self.tree.GetItemText(event.GetItem()))
        dropSource = wx.DropSource(self.tree)
        dropSource.SetData(tdo)
        dropSource.DoDragDrop(True)

app = wx.PySimpleApp()
frame = DragFrame()
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
